Skip to content

Honor stderrthreshold when logtostderr is enabled#428

Open
pierluigilenoci wants to merge 2 commits intokubernetes-sigs:masterfrom
pierluigilenoci:fix/honor-stderrthreshold
Open

Honor stderrthreshold when logtostderr is enabled#428
pierluigilenoci wants to merge 2 commits intokubernetes-sigs:masterfrom
pierluigilenoci:fix/honor-stderrthreshold

Conversation

@pierluigilenoci
Copy link
Copy Markdown
Member

What

Bump k8s.io/klog/v2 to v2.140.0 and opt out of the legacy stderr threshold behavior so that -stderrthreshold is respected even when -logtostderr=true (the klog v2 default).

Why

klog v2 defaults -logtostderr to true, which silently ignores -stderrthreshold. All log levels are unconditionally sent to stderr, making severity-based filtering impossible for log aggregation systems.

This was reported in kubernetes/klog#212 and fixed upstream in kubernetes/klog#432.

How

  • Set legacy_stderr_threshold_behavior=false after flag.Set("logtostderr", ...) in hack/smoketest.go to opt into the corrected behavior
  • Set stderrthreshold=INFO as default to preserve current behavior (all logs still go to stderr)
  • Users can now override via -stderrthreshold=WARNING or -stderrthreshold=ERROR

Bump k8s.io/klog/v2 to v2.140.0 and opt out of the legacy stderr
threshold behavior so that -stderrthreshold is respected even when
-logtostderr=true (the default).  Set stderrthreshold=INFO to preserve
current behavior; users can now override it on the command line.

Ref: kubernetes/klog#212, kubernetes/klog#432
Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pierluigilenoci
Once this PR has been reviewed and has the lgtm label, please assign atoato88 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 24, 2026
The kubernetes-sigs org now requires all actions to be pinned to
full-length commit SHAs. Update actions/checkout from v1/v2 tags to
v4.2.2 (11bd719) and actions/setup-go from v5 tag to v5.3.0
(f111f33), matching the pattern already used in tag-release.yaml.

This fixes the CI failures:
  "The actions actions/checkout@v2 and actions/setup-go@v5 are not
  allowed because all actions must be pinned to a full-length commit
  SHA."

Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
@pierluigilenoci
Copy link
Copy Markdown
Member Author

All three CI failures (verify-goimports, verify-gomod, Kind cluster test) were caused by the same root issue: the kubernetes-sigs org now enforces that all GitHub Actions must be pinned to full-length commit SHAs. The workflow was using tag references (actions/checkout@v2, actions/checkout@v1, actions/setup-go@v5).

Fixed by pinning all actions in .github/workflows/main.yml to their full commit SHAs:

  • actions/checkout → v4.2.2 (11bd71901bbe5b1630ceea73d27597364c9af683)
  • actions/setup-go → v5.3.0 (f111f3307d8850f501ac008e886eec1fd1932a34)

This matches the pinning pattern already used in tag-release.yaml.

Note: this is a repo-wide issue — other open PRs (#424, #427) have the same CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants